package com.example.esp8266.Library.RoomLib.Dao_Interface;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.example.esp8266.Library.RoomLib.TaskGroup;

import java.util.List;

@Dao
public interface TaskGroupDao {
    @Insert
    long insert(TaskGroup taskGroup);

    @Update
    void update(TaskGroup taskGroup);

    @Delete
    void delete(TaskGroup taskGroup);

    @Query("SELECT * FROM task_group")
    List<TaskGroup> getAllTaskGroups();

    @Query("DELETE FROM task_group")
    void deleteAll();  // 删除所有记录的方法
}